<?php
function include_fb_like($url, $parameters = array())
{
  if(sfConfig::get('app_fbOpenGraphHelper_printLikeButton', false))
  {
    $defaultParameters= array(
        'layout' => 'standard',
        'show_faces' => 'true' ,
        'width' => '450',
        'action' => 'like',
        'colorscheme' => 'light'
    );
    
    $parametersFromConfig = (sfConfig::has('app_fbOpenGraphHelper_parameters') && is_array(sfConfig::get('app_fbOpenGraphHelper_parameters'))) ? sfConfig::get('app_fbOpenGraphHelper_parameters') : array();
    
    $p = array_merge($defaultParameters, $parametersFromConfig, $parameters);
    
    ?><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($url); ?>&amp;layout=<?php echo $p['layout']; ?>&amp;show_faces=<?php echo (string) $p['show_faces']; ?>&amp;width=<?php echo (string) $p['width']; ?>&amp;action=<?php echo (string) $p['action']; ?>&amp;colorscheme=<?php echo (string) $p['colorscheme']; ?>&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe><?php
  }
  else
  {
    ?>Like Placeholder<?php
  }
}

function include_fb_share($type = 'box_count')
{
  if(sfConfig::get('app_fbOpenGraphHelper_printLikeButton', false))
  {
    ?><a name="fb_share" type="box_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script><?php
  }
  else
  {
    ?>Share Placeholder<?php
  }
}


function set_open_graph_meta_tags($ogValues)
{
  slot('openGraphMetaTag', get_component('sfOpenGraphMetaTagPlugin', 'setOpenGraphMetaTag', array('ogValues' => $ogValues)));
}

?>